<?php

/**
 * @name IndexController
 * @desc 控制器
 */
class IndexController extends ApiBaseController
{
    /**
     * 首页数据
     */
    public function indexAction()
    {

        $sysConfigModel = SysConfigModel::getSingleton();
        $marketData = $sysConfigModel->findAll(['group'=> 'market']);

        $arr = [];
        foreach($marketData as $val){
            $arr[$val['index']] = $val['value'];
        }

        $returnData['coin_stock_total'] = floatval($arr['coin_stock_total']); //今日挖币量
        $returnData['coin_issue_total'] = floatval($arr['coin_issue_total']); //总资产
        $returnData['coin_stock_day_total'] = floatval($arr['coin_stock_day_total']); //今日挖币量
        $returnData['coin_j_total'] = floatval($arr['coin_j_total']); //智能算力总额
        $returnData['coin_d_total'] = floatval($arr['coin_d_total']); //链接算力总额

        $this->ajaxReturn(0,'success', $returnData);
    }
}
